{template header}

<style type="text/css">
.boldTitle{float:left; font-size:14px; font-weight:bold; padding:5px;}
</style>
<div class="maininfo">
	<div class="lattice x1" style="padding-left: 0;">
		{template userlogin}
	</div>
	
	<script language="javascript" type="text/javascript">
		J(function(){
			J('#theform').submit(function(){
				if(J('input[name=logisticId]:checked').length==0){
					alert('你至少需要选择一种配送方式 ！');
					return false;
				}
				if(J('input[name=payType]:checked').length==0){
					alert('你至少需要选择一种支付方式！');
					return false;
				}
			});
			
			J('#DistributionSubmit').bind('click', function(){				
				J.ajax({
					type: "POST",
					url: 'cart-consignee.htm?action=distributionUpdate&id={$info[id]}',
					data: J('#theform').serialize(),
					cache: false,
					dataType: 'json',
					beforeSend: function(){
						J('#DistributionSubmit').attr('disabled','disabled');
						J('#loaddingImg').html('<img src="{GODHOUSE_DOMAIN_IMAGE}images/default/loading.gif" width="18" height="18" />');
						J('#loaddingText').html('请稍后，正在处理...');
					},
					success: function(data){
						if(data['state']==1) {							
							J('#ConsigneeInfo span').each(function(){
								if(J(this).attr('id')=='area') {	
									var province = J(this).children().eq(0).find("option:selected").text();
									var area = J(this).children().eq(1).find("option:selected").text();
									J('#areaInfo').html(J(this).html());
									J(this).html(area + '->' + province);
								}else{
									J(this).html(J(this).children().val());
								}
							});
							
							J('#consigneeId').val(data['insertId']);
							J('#DistributionSubmit').attr('disabled','');
							J('#loaddingImg').html('');
							J('#loaddingText').html('');
							J('#displaySubmit').hide();
						}
					}
				});
			});
			
			J('#consigneeEdit').bind('click', function(){
				var areaInfo = J('#areaInfo').html();
				if(J.trim(areaInfo)!=''){
					J('#ConsigneeInfo span').each(function(){
						if(J(this).attr('id')=='area') {						
							J('#areaInfo').empty();
							J(this).html(areaInfo);
							J('#province').val(J(this).attr('province')).change();
						}else{
							J(this).html('<input class=inputbg '+(J(this).attr('id')=='address' ? 'style="width:260px;"' : '' )+' name=info['+J(this).attr('id')+'] value="'+J(this).html()+'">');
						}
					});
					J('#displaySubmit').show();
				}
			});
		})
	</script>
	<div class=x4>
		<form id=theform name=theform action="" method="post">		
			<div style="border-top:2px #009900 solid">
				<span class="boldTitle">商品列表</span>
				<a style="float:right; font-weight:bold; color:#0033CC" href="/cart.htm">修改</a>
			</div>		
			<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="15%" height="22" align="center" bgcolor=#ffffff>订货号</th>
						<th width="30%" height="22" align="center" bgcolor=#ffffff>产品说明</th>
						<th width="13%" height="22" align="center" bgcolor=#ffffff>本店价格   </th>
						<th width="13%" height="22" align="center" bgcolor=#ffffff>会员价格</th>
						<th width="12%" height="22" align="center" bgcolor=#ffffff>小计</th>
						<th width="10%" align="center" bgcolor=#ffffff>优惠</th>
						<th width="7%" align="center" bgcolor=#ffffff>数量</th>
					</tr>
					<!--{loop $CartArr[shopCartArr] $list}-->
					<tr>
						<td height="22" align="center" bgcolor=#ffffff><input name="cartId[]" type="hidden" value="{$list[cartId]}" />{$list[productNo]} </td>
						<td height="22" align="center" bgcolor=#ffffff>{$list[content]}</td>
						<td height="22" align=center bgcolor=#ffffff>￥$list[ourPrice]</td>
						<td height="22" align=center bgcolor=#ffffff class=price>￥$list[userPrice]</td>
						<td height="22" align=center bgcolor=#ffffff>￥$list[totalPrice]</td>
						<td align=center bgcolor=#ffffff class=price>￥$list[offerPrice]</td>
						<td align=center bgcolor=#ffffff class=price>$list[cartCount]</td>
					</tr>
					<!--{/loop}-->
					<tr>
						<td style="font-size:14px; color:#FE6500; padding-left:10px; font-weight:bold" bgcolor=#ffffff colspan=8>购物金额小计￥{$CartArr[totalPrice]}元</td>
					</tr>
				</tbody>
			</table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">收货人信息</span>
				<a style="float:right; font-weight:bold; color:#0033CC" href="#1" id="consigneeEdit">修改</a>
			</div>
			<div id="areaInfo" style="display:none">
				<select name="info[province]" id="province" style="width: 120px;" onchange="ajaxget('site-ajaxCity-'+this.value+'.htm', 'showCity', 'showCity', null, function(){J('#city').val(J('#area').attr('city'))})">
					<option value="">请选择区域</option>
					<!--{loop $areaList $v}-->
					<option value="{$v[id]}" {if $area[fId]==$v[id]}selected="selected"{/if}>{$v[name]}</option>
					<!--{/loop}-->
				</select>
				<label id="showCity">
				<select name="info[city]" id="city" style="width: 120px;">
					<option value="">请选择区域</option>
				</select>
				</label>
				<label style="color:red" id="err_city"></label>

			</div>
			<table cellspacing=1 cellpadding=5 width="99%" align=center bgcolor=#dddddd border=0 id="ConsigneeInfo">
				<tbody>
					<tr>
					  <td width="15%" align="right" bgcolor=#ffffff>地区：</td>
					  <td bgcolor=#ffffff><span id="area" province="{$info[province]}" city="{$info[city]}">{$info[cityInfo]}</span></td>
					  <td width="16%" align="right" bgcolor="#ffffff">电子邮件地址：</td>
					  <td width="32%" bgcolor="#ffffff"><span id="email">{$info[email]}</span></td>
				  </tr>
					<tr>
						<td align="right" bgcolor=#ffffff>收货人姓名：</td>
						<td width="37%" bgcolor=#ffffff><span id="realName">{$info[realName]}</span></td>
						<td align="right" bgcolor="#ffffff">邮政编码：</td>
						<td bgcolor="#ffffff"><span id="zipcode">{$info[zipcode]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>详细地址：</td>
						<td bgcolor=#ffffff><span id="address">{$info[address]}</span></td>
						<td align="right" bgcolor="#ffffff">手机：</td>
						<td bgcolor="#ffffff"><span id="mobile">{$info[mobile]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>电话：</td>
						<td bgcolor=#ffffff><span id="phone">{$info[phone]}</span></td>
						<td align="right" bgcolor="#ffffff">最佳送货时间：</td>
						<td bgcolor="#ffffff"><span id="bestTime">{$info[bestTime]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>标志建筑：</td>
						<td bgcolor=#ffffff><span id="signBuilding">{$info[signBuilding]}</span></td>
						<td align="right" bgcolor=#ffffff>&nbsp;</td>
						<td bgcolor=#ffffff>&nbsp;</td>
					</tr>
					<tr id="displaySubmit" style="display:none">
					  <td align=center bgcolor=#ffffff colspan=4>
						  <table width="100%" border="0" cellpadding="0" cellspacing="0">
							  <tr>
								<td width="51%" align="right"><input type=button value=配送至这个地址 name=submit id="DistributionSubmit"></td>
								  <td width="2%" align="left" style="padding-left:2px; padding-right:2px;" id="loaddingImg"></td>
								  <td width="47%" style="text-align:left"><label style="color:red" id="loaddingText"></label></td>
							  </tr>
						  </table>						  
					  </td>
					</tr>
				</tbody>
		  </table>
			  
			  
			  
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">配送方式</span>
			</div>
			<table class=floattable id=shippingtable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="5%" bgcolor=#ffffff>&nbsp;</th>
						<th width="18%" bgcolor=#ffffff>名称</th>
						<th width="77%" bgcolor=#ffffff>订购描述</th>
					</tr>
					<!--{loop $logisticArr $list}-->
					<tr>
						<td valign=top bgcolor=#ffffff><input type=radio value="{$list[logisticId]}" name="logisticId"> </td>
						<td valign=top bgcolor=#ffffff><strong>{$list[title]}</strong></td>
						<td valign=top bgcolor=#ffffff>{$list[content]}</td>
					</tr>
					<!--{/loop}-->
				</tbody>
			</table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">支付方式</span>
			</div>
			<table class=floattable id=paymenttable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="5%" bgcolor=#ffffff>&nbsp;</th>
						<th width="21%" bgcolor=#ffffff>名称</th>
						<th width="59%" bgcolor=#ffffff>订购描述</th>
						<th width="15%" bgcolor=#ffffff>手续费</th></tr>
					<tr>
						<td valign=top bgcolor=#ffffff><input type=radio value="1" name=payType></td>
						<td valign=top bgcolor=#ffffff><strong>网上转帐</strong></td>
						<td valign=top bgcolor=#ffffff>使用帐户余额支付。只有会员才能使用，通过设置信用额度，可以透支。</td>
						<td class=f1 valign=top align=right bgcolor=#ffffff>￥0.00元</td></tr>
					<tr>
						<td valign=top bgcolor=#ffffff><input type=radio value=2 name=payType iscod="0"></td>
						<td valign=top bgcolor=#ffffff><strong>银行汇款/转帐</strong></td>
						<td valign=top bgcolor=#ffffff>银行名称收款人信息：全称 ××× ；帐号或地址 ××× ；开户行 ×××。注意事项：办理电汇时，请在电汇单“汇款用途”一栏处注明您的订单号。</td>
						<td class=f1 valign=top align=right bgcolor=#ffffff>￥0.00元</td>
					</tr>
					<tr>
					  <td valign=top bgcolor=#ffffff><input type="radio" value="3" name="payType" iscod="0" /></td>
					  <td valign=top bgcolor=#ffffff><strong>货到付款</strong></td>
					  <td valign=top bgcolor=#ffffff>&nbsp;</td>
					  <td class=f1 valign=top align=right bgcolor=#ffffff>￥0.00元</td>
				  </tr>
				</tbody>
			</table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">其它信息</span>
			</div>
			<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<td valign=top bgcolor=#ffffff><strong>订单附言:</strong></td>
						<td bgcolor=#ffffff><textarea class=inputborder id=remark name=remark rows=3 cols=80></textarea></td>
					</tr>
				</tbody>
			</table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle" style="float:right">费用总计</span>
			</div>
			<div id=ecs_ordertotal>
				<table cellspacing=1 cellpadding=5 width="100%" align=center border=0 style="clear:both">
					<tbody>
						<tr>
							<td align=right bgcolor=#ffffff>商品总价: <font style="color:#FE6500; font-weight:bold">￥{$CartArr[totalPrice]}元</font> </td>
						</tr>
						<tr>
							<td align=right bgcolor=#ffffff>应付款金额: <font style="color:#FE6500; font-weight:bold">￥{$CartArr[totalPrice]}元</font> </td>
						</tr>
					</tbody>
				</table>
			</div>
			
			<div style="margin: 8px auto" align=center>
			<input type="hidden" name="totalPrice" value="{$CartArr[totalPrice]}" />
				<input type=image src="{GODHOUSE_DOMAIN_IMAGE}images/default/bnt_suborder.gif"> 
				<input type=hidden value=done name=step> 
			</div>
		</form>
	</div>
	
</div>
{template footer}